<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>联系我们</title>
</head>
<body>
    <div class="bottom">
        <!-- 中间头部垂直 -->
        <div class="bottom-top">
                <img src="http://first.52carlife.com/newfooterlogo@2x.png" alt="52">
                <span>A New Typical Internet Enterprise in the Background of Big Data Era</span>
        </div>
        <!-- 中间 -->
        <div class="bottom-center">
            <!-- 左边 -->
                <div class="massege-left">
                    <span>在线留言</span>
                    <div class="massage-h">
                        <div></div>
                    </div>
                    <form class="bs-example bs-example-form form-massege" role="form">
                            <div class="input-group message-inp">
                                <input type="text" class="form-control" placeholder="你的名字" id="userName">
                            </div>
                            <div class="input-group message-inp">
                                <input type="email" class="form-control" placeholder="邮箱地址" id="userEmail">
                            </div>
                            <textarea  class="form-control" id="userContent" name="deblock_udid" rows="5" placeholder="请输入文字"></textarea>
                            <button type="text" class="but-bg" id="createCustomer" onclick="return false">
                                    <img src="http://first.52carlife.com/newfooterbtn@2x.png"></img>
                            </button>
                        </form>
                </div>
                <!-- 右边 -->
                <div class="massege-center">
                    <div class="right-title">
                        <img src="http://first.52carlife.com/newfooter%E9%82%AE%E7%AE%B1@2x.png" alt="52">
                        <span>carlife52@163.com</span>
                    </div>
                    <div class="right-title-phone">
                        <img src="http://first.52carlife.com/newfooter%E7%94%B5%E8%AF%9D@2x.png" alt="52">
                        <span>0772-2999255</span>
                    </div>
                    <div class="right-title-address">
                        <img src="http://first.52carlife.com/newfooter%E5%9C%B0%E5%9D%80@2x.png" alt="52">
                        <span>柳州市温州街1号温州商贸城一区4-1号</span>
                    </div>
                </div>
                <!-- 最右边 -->
                <div class="message-right">
                    <span>企业公众号</span>
                    <img src="http://first.52carlife.com/newfooter%E6%9C%8D%E5%8A%A1%E5%8F%B7@2x.png" alt="52">
                </div>
        </div>
        <!-- 最下面导航 -->
  
        <div class="bottom-footer">
                <div class="footer-left">
                        <span>页面导航</span>
                        <ul>
                            <li><a> 首页 </a></li>
                            <li><a> 关于我们 </a></li>
                            <li><a> 服务项目 </a></li>
                            <li><a> 客户案例 </a></li>
                            <li><a> 新闻资讯 </a></li>
                            <li><a> 联系我们</a></li>
                        </ul>
                </div>
                <div class="footer-right">
                        <ul class="right-icon">
                            <li> <img src="http://first.52carlife.com/newfooterIcon%20%E6%8B%B7%E8%B4%9D@2x.png" alt="52"></li>
                            <li> <img src="http://first.52carlife.com/newfooterIcon2%20%E6%8B%B7%E8%B4%9D@2x.png" alt="52"> </li>
                            <li> <img src="http://first.52carlife.com/newfooterIcon3%20%E6%8B%B7%E8%B4%9D@2x.png" alt="52"> </li>
                            <li> <img src="http://first.52carlife.com/newfooterIcon4%20%E6%8B%B7%E8%B4%9D@2x.png" alt="52"> </li>
                            <li> <img src="http://first.52carlife.com/newfooterIcon5%20%E6%8B%B7%E8%B4%9D@2x.png" alt="52"></li>
                        </ul>
                        <div class="right-copy" id="navGov">
                                
                                <a href="http://www.beian.miit.gov.cn">&copy;备案号:桂ICP备17003197号</a>
                            <!-- <a href="wwww.beian.miit.gov.cn">
                                    
                            </a>                             -->
                        </div>
                    </div>
                   
        </div>
    </div>
    <!-- 发送 -->
    <script>
        // 获取值
    $("#createCustomer").on('click',function(e) {
        var userName = $("#userName").val();
        var userContent = $("#userContent").val();
        var userEmail = $("#userEmail").val();
        // 先判断不能为空
        if(userName == "" || userContent == "" || userEmail == ""){
            alert("亲！输入不能为空"); 
    }else{
         // 判断邮箱是否正确
        var re = /^[A-Za-z\d]+([-_.][A-Za-z\d]+)*@([A-Za-z\d]+[-.])+[A-Za-z\d]{2,4}$/; 
        if (re.test(userEmail)) {
            $.ajax({
				url: 'http://www.52carlife.com/addInfoApi',
				type: 'POST',
				data:{
					name:userName,
					mail:userEmail,
					content:userContent
				},
				success: function (result) {
					console.log(result)
                    alert("提交成功");
                    $("#userName").val("");
                    $("#userContent").val("");
                    $("#userEmail").val("")
		    }
			});
        } else {
            alert("邮箱输入不正确");
        }
    }
})
    </script>
</body>
</html>